package jvmStudy.demo01.ClassLoader;

public class test05 {
    public static void main(String[] args) {
        Runnable r=new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName()+"正在启动");
                DeadThread deadThread=new DeadThread();
                System.out.println(Thread.currentThread().getName()+"结束");
            }
        };
        Thread thread=new Thread(r,"c1");
        Thread thread2=new Thread(r,"c2");
        thread.start();
        thread2.start();
    }
    static class DeadThread{

        static {

           if (true){
               System.out.println(Thread.currentThread().getName()+"正在执行该方法");  //这个类只能被clinit一次
               while(true){

               }
           }
        }
    }
}
